/********************************************************************************
 *      Copyright:  (C) 2014 EAST
 *                  All rights reserved.
 *
 *       Filename:  msgque.h
 *    Description:  This head file 
 *
 *        Version:  1.0.0(08/14/2014)
 *         Author:  fulinux <fulinux@sina.com>
 *      ChangeLog:  1, Release initial version on "08/14/2014 11:31:33 AM"
 *                 
 ********************************************************************************/
#ifndef _MSGQUE_H_
#define _MSGQUE_H_

#define MSGQUEFILE "/tmp/msgque.tmp"
#define MSGSIZE 515

struct msgbuf {
    long mtype;
    char mtext[MSGSIZE];
};

typedef struct msgbuf msgbuf_t;

struct msgque {
    int msgid;
    int msgflg;
    int debug;
    msgbuf_t msgbuf;
};

typedef struct msgque msgque_t;

int msgque_read (msgque_t *msgque);
int msgque_write (msgque_t *msgque);
int msgque_setdebug(msgque_t *msgque, int flag);

int msgque_init (msgque_t *msgque, int fid);
int msgque_exit (msgque_t *msgque);

#endif /* _MSGQUE_H_ */
